<!DOCTYPE html>
<html >

<head>
<meta charset="UTF-8">
<title>Sign Up Login</title>
<link rel="stylesheet" href="css/style.css">
</head>

<body>

<div class="cotn_principal">
  <div class="cont_centrar">
    <div class="cont_login">
      <div class="cont_info_log_sign_up">
        <div class="col_md_login">
          <div class="cont_ba_opcitiy">
            <h2>LOGIN</h2>
            <p>Lorem ipsum dolor sit amet, consectetur.</p>
            <button class="btn_login" onClick="cambiar_login()">LOGIN</button>
          </div>
        </div>
        <div class="col_md_sign_up">
          <div class="cont_ba_opcitiy">
            <h2>SIGN UP</h2>
            <p>Lorem ipsum dolor sit amet, consectetur.</p>
            <button class="btn_sign_up" onClick="cambiar_sign_up()">SIGN UP</button>
          </div>
        </div>
      </div>
      <div class="cont_back_info">
        <div class="cont_img_back_grey"> <img src="po.jpg" alt="" /> </div>
      </div>
      <div class="cont_forms" >
        <div class="cont_img_back_"> <img src="po.jpg" alt="" /> </div>
          <form action="login_two" method="post">
              {{csrf_field()}}
        <div class="cont_form_login"> <a href="#" onClick="ocultar_login_sign_up()" ><i class="material-icons">&#xE5C4;</i></a>
          <h2>LOGIN</h2>
            <input type="text" placeholder="UserName" name="user_name"/>
            <input type="text" placeholder="PassWord" name="user_pwd"/>
            <button class="btn_login">LOGIN</button>
        </div>
              </form>
          <form action="login" method="post">
              {{csrf_field()}}
        <div class="cont_form_sign_up"> <a href="#" onClick="ocultar_login_sign_up()"><i class="material-icons">&#xE5C4;</i></a>
          <h2>SIGN UP</h2>
          <input type="text" placeholder="用户名" name="user_name" class="onec"/><span style="color: red" class="spn"></span>
          <input type="password" placeholder="密码:默认00000" name="user_pwd" class="pwd"/>
          <input type="password" placeholder="确认密码" name="t_user_pwd" class="pwds"/>
            <input type="text" placeholder="Email" name="email" class="email"/>
          <button class="btn_sign_up">SIGN UP</button>
        </div>
          </form>
      </div>
    </div>
  </div>
</div>

<script src="js/index.js"></script>
<div style="text-align:center;">
<p>来源:<a href="http://www.mycodes.net/" target="_blank">源码之家</a></p>
</div>
</body>
</html>
<script src="js/jquery-1.8.2.min.js"></script>
<script>
    $('.onec').blur(function(){
        var obj=$(this);
        var spn=$(".spn");
        var sub=$('.btn_sign_up');
        var user_name=$('.onec').val();
        var email=$('.email').val();
        $.ajax({
            url:"ajax",
            data:"user_name="+user_name,
            success:function(msg){
                if(msg==1){
                    obj.css({background:'gray'});
                    spn.html('*');
                    sub.attr("disabled", true);
                }else{
                    obj.css({background:''});
                    spn.html('');
                    sub.attr("disabled", false);
                }
            }
        });
    });
    $(".pwds").blur(function(){
        var obj=$(this);
        var sub=$('.btn_sign_up');
        var pwd=$(".pwd").val();
        var pwds=$(".pwds").val();
        if(pwd!=pwds){
            obj.css({background:'gray'});
            sub.attr("disabled", true);
        }else{
            obj.css({background:''});
            sub.attr("disabled", false);
        }
    });
</script>
